package train.DAY620;

public class HomeWork {
    public static void main(String[] args) {
        int[] a={2,3,1,6,5,0};
        int[] ints = paoSort(a);
        for (int anInt : ints) {
            System.out.println("anInt = " + anInt);
        }
    }

    //冒泡排序
    public static int[] paoSort(int[] nums){
        for (int i = nums.length-1;i>=0 ; i--) {
            for (int j = 0; j < i; j++) {
                if (nums[j] > nums[j + 1]) {
                    int temp = nums[j];
                    nums[j]=nums[j+1];
                    nums[j+1]=temp;

                }
            }
        }
        return nums;
    }
}
